package cn.pms.po;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import cn.pms.type.CheckState;

/**
 * Check entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_check", schema = "SCOTT")
public class Check implements java.io.Serializable
{
	private static final long serialVersionUID = -5534779979706425886L;
	// Fields
	private Integer id;
	private Employee employee;
	private Department department;
	private Date date;
	private CheckState chkState;
	private Integer time;
	private String remark;
	
	// Constructors
	/** default constructor */
	public Check()
	{}
	
	/** minimal constructor */
	public Check(Employee employee, Department department, Date date,
			CheckState chkState, Integer time)
	{
		this.employee = employee;
		this.department = department;
		this.date = date;
		this.chkState = chkState;
		this.time = time;
	}
	
	/** full constructor */
	public Check(Employee employee, Department department, Date date,
			CheckState chkState, Integer time, String remark)
	{
		this.employee = employee;
		this.department = department;
		this.date = date;
		this.chkState = chkState;
		this.time = time;
		this.remark = remark;
	}
	
	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, precision = 32, scale = 0)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CHK")
	@SequenceGenerator(name = "SEQ_CHK", sequenceName = "SEQ_CHK", allocationSize = 1)
	public Integer getId()
	{
		return this.id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "empId", nullable = false)
	public Employee getEmployee()
	{
		return this.employee;
	}
	
	public void setEmployee(Employee employee)
	{
		this.employee = employee;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "depId", nullable = false)
	public Department getDepartment()
	{
		return this.department;
	}
	
	public void setDepartment(Department department)
	{
		this.department = department;
	}
	
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "dateId", nullable = false)
	public Date getDate()
	{
		return this.date;
	}
	
	public void setDate(Date date)
	{
		this.date = date;
	}
	
	@Column(name = "chkState", nullable = false, length = 100)
	@Enumerated(EnumType.STRING)
	public CheckState getChkState()
	{
		return this.chkState;
	}
	
	public void setChkState(CheckState chkState)
	{
		this.chkState = chkState;
	}
	
	@Column(name = "time", nullable = false)
	public Integer getTime()
	{
		return this.time;
	}
	
	public void setTime(Integer time)
	{
		this.time = time;
	}
	
	@Column(name = "remark", length = 500)
	public String getRemark()
	{
		return this.remark;
	}
	
	public void setRemark(String remark)
	{
		this.remark = remark;
	}
}
